<?php
/**
 * This is it!
 * 
 * @name CMS
 * @author Maxim Vavilov
 * @link http://www.codeboy.ru
 * @copyright Maxim Vavilov
 * @version 0.0.2
 * 
 * @todo global - REmake wiki for code-cms
 */


/* CODEIGNITER PART
------------------------------------------------*/

// PHP ERROR REPORTING LEVEL
	error_reporting(E_ALL);
// SYSTEM FOLDER NAME
	$system_folder = "engine";
// APPLICATION FOLDER NAME
	$application_folder = "../application";


// SET THE SERVER PATH
if (strpos($system_folder, '/') === FALSE)
{
	if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
	{
		$system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
	}
}
else
{
	// Swap directory separators to Unix style for consistency
	$system_folder = str_replace("\\", "/", $system_folder); 
}

/*
| DEFINE APPLICATION CONSTANTS
|
| EXT		- The file extension.  Typically ".php"
| FCPATH	- The full server path to THIS file
| SELF		- The name of THIS file (typically "index.php")
| BASEPATH	- The full server path to the "system" folder
| APPPATH	- The full server path to the "application" folder
|
*/
define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
define('FCPATH', __FILE__);
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('BASEPATH', $system_folder.'/');

if (is_dir($application_folder))
{
	define('APPPATH', $application_folder.'/');
}
else
{
	if ($application_folder == '')
	{
		$application_folder = 'application';
	}

	define('APPPATH', BASEPATH.$application_folder.'/');
}


// global CMS path definition
define('MY_CSS', '/static/css');
define('MY_IMG', '/static/images');
define('MY_JS', '/static/script');


// LOAD THE FRONT CONTROLLER
require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;

/* End of file index.php */
/* Location: ./index.php */